package com.ruoyi.business.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.business.mapper.BusinessMapper;
import com.ruoyi.business.domain.Business;
import com.ruoyi.business.service.IBusinessService;

/**
 * 项目业务Service业务层处理
 *
 * @author ruoyi
 * @date 2025-05-27
 */
@Service
public class BusinessServiceImpl implements IBusinessService
{
    @Autowired
    private BusinessMapper businessMapper;

    /**
     * 查询项目业务
     *
     * @param id 项目业务主键
     * @return 项目业务
     */
    @Override
    public Business selectBusinessById(Long id)
    {
        return businessMapper.selectBusinessById(id);
    }

    /**
     * 查询项目业务列表
     *
     * @param business 项目业务
     * @return 项目业务
     */
    @Override
    public List<Business> selectBusinessList(Business business)
    {
        return businessMapper.selectBusinessList(business);
    }

    /**
     * 新增项目业务
     *
     * @param business 项目业务
     * @return 结果
     */
    @Override
    public int insertBusiness(Business business)
    {
        business.setCreateTime(DateUtils.getNowDate());
        return businessMapper.insertBusiness(business);
    }

    /**
     * 修改项目业务
     *
     * @param business 项目业务
     * @return 结果
     */
    @Override
    public int updateBusiness(Business business)
    {
        business.setUpdateTime(DateUtils.getNowDate());
        return businessMapper.updateBusiness(business);
    }

    /**
     * 批量删除项目业务
     *
     * @param ids 需要删除的项目业务主键
     * @return 结果
     */
    @Override
    public int deleteBusinessByIds(Long[] ids)
    {
        return businessMapper.deleteBusinessByIds(ids);
    }

    /**
     * 删除项目业务信息
     *
     * @param id 项目业务主键
     * @return 结果
     */
    @Override
    public int deleteBusinessById(Long id)
    {
        return businessMapper.deleteBusinessById(id);
    }
}

